#-----------------------------------------------------------------------------
# Misc
#-----------------------------------------------------------------------------

# Banish the mouse on startup
banish

# Change default escape key
escape M-w

# Facilitate setting binds to the top keymap
alias topbind definekey top

# Disable startup message
set startupmessage 0

# Resizing
set resizeunit 20
topbind M-r resize

# Show time
topbind M-t time

# Banish the rat to the bottom left corner of the screen on any key press
addhook key banish

# Multiple workspaces
exec /usr/bin/rpws init 6 -k

# Workspaces movement
topbind C-M-l rpwsn
topbind C-M-h rpwsp
topbind C-M-L rpwsmn
topbind C-M-H rpwsmp

# Styling
set border 0
set barborder 0
set barpadding 0 0
set fgcolor white
set bgcolor black
set font JuliaMono

#-----------------------------------------------------------------------------
# Frame actions
#-----------------------------------------------------------------------------

# Create and remove frames
topbind M-s hsplit
topbind M-S vsplit
topbind M-d remove

# Frame movement
topbind M-l focusright
topbind M-h focusleft
topbind M-k focusup
topbind M-j focusdown
topbind M-Tab next

# Frame swapping
topbind M-L exchangeright
topbind M-H exchangeleft
topbind M-K exchangeup
topbind M-J exchangedown

#-----------------------------------------------------------------------------
# Program actions
#-----------------------------------------------------------------------------

# Stop program
topbind M-D delete

# More violent approach to stop programs
topbind M-Q kill

# Launch firefox or firefox-bin (Gentoo specific)
topbind M-f exec firefox || firefox-bin

# Modify volume using ratvol
topbind M-minus exec ratvol -p -t 1 -g c
topbind M-plus  exec ratvol -p -t 1 -g c +

# Toggles the touchpad state (depends on the touchpad function in .bash_profile)
topbind M-T exec touchpad -t

# Hibernate using logingctl
bind C-H exec loginctl hibernate
